
<cfmodule template="#CLIENT.COMMON_PATH#check_transact_dsn.cfm" USERID = "#CLIENT.CHAPA#" TRANSACT_DSN ="#CLIENT.TRANSACT_DSN#">
<CFIF ISDEFINED("FORM.btnBackAction")>
	<CFLOCATION url="#client.domain#edtr/">
</CFIF>
<CFMODULE TEMPLATE = "#client.common_path#cfm_checkuserrecords.cfm" USERTABLE = "EGRGUSERAPPS"
	USERFIELD = "USERGRPID_FK" RECORDFIELD = "APPCODE_FK" USERTABLEDSN="#client.global_dsn#" RECORDID="EDTRMANAGER">
<CFMODULE TEMPLATE="#client.common_path#cfm_geturlvariables.cfm" INCLUDEURL="type">

<CFIF urlVariables NEQ "">
	<CFSET urlVariables2 = "&" & urlVariables>
	<CFSET urlVariables = "?" & urlVariables>
<CFELSE>
	<CFSET urlVariables = "">
	<CFSET urlVariables2 = "">
</CFIF>

<CFIF ListLen(userRecords) EQ 0>
	<CFSET sModule ="dtr">
	<CFSET sTitle ="iBOS/e eDTR">
	<CFLOCATION url="#client.common_path#cfm_norights.cfm">
</CFIF>
<CFSET nameType = "eDTR">
<CFSET nameTitle = "eDTR">
<!---<CFIF isdefined("url.powermast")>
	<CFSET nameTitle = "iBOS/e eWorkSked Power User">
</CFIF>--->

<CFSET nameModule = "dtr">
<CFSET nameLocation = "../">
<CFPARAM NAME="sMess" DEFAULT= "">
<CFPARAM NAME="sWarn" DEFAULT= "">
<CFMODULE TEMPLATE="#client.common_path#cfm_DBdateFormat.cfm">
<CFSET sDateNow = dateResult>
<SCRIPT LANGUAGE="JavaScript">
	<!--
	function confirmThis(message) {
		if(confirm(message)) return true;
			return false;
	}
	-->
</SCRIPT>
<CFINCLUDE TEMPLATE="#client.common_path#_toggle.cfm">

<HTML>
	<HEAD>
		<TITLE>iBOS/e WebShell - eDTR manager</TITLE>
		<CFOUTPUT>
			<LINK REL="StyleSheet" HREF="#client.wstheme_path##client.empcolor#.css" TYPE="text/css">
		</CFOUTPUT>
	</HEAD>
<CFQUERY name="qryECRGDTR" datasource="#CLIENT.COMPANY_DSN#">
	SELECT A.EDTRCODE,A.EDTRGROUP,A.EDTRDESC,  
		B.CUTOFFSTARTDATE,B.CUTOFFENDDATE,A.SHAREDVIEW,A.SHAREDUPDATE
	FROM ECRGDTR A,CRGTKFILES B
	WHERE A.TKFILENAME_FK = B.TKFILENAME
		ORDER BY B.CUTOFFSTARTDATE DESC,A.EDTRGROUP
</CFQUERY>
<CFQUERY name="getEDTRGROUPS" dbtype="query">
	SELECT DISTINCT (EDTRGROUP)
	FROM qryECRGDTR
</CFQUERY>
<CFIF STRUCTKEYEXISTS(FORM,"btnSAVENEWEDTR")>
	<CFINCLUDE template="./func_savenewedtr.cfm">
<CFELSEIF STRUCTKEYEXISTS(URL,"delete")>
	<CFINCLUDE template="./func_deleteedtr.cfm">
</CFIF>

	<BODY TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>
		<CFMODULE TEMPLATE="#client.common_path#cfm_workspace.cfm" COMPONENT="#nameTitle# Manager" MODULE="utilities" LOCATION="../../webshell/">
		<!---<CFSET client.isPowerUser=false>--->
		<CFIF sMess NEQ "">
			<CFOUTPUT>
				<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Information">
				<BR><B>#sMess#</B><BR>
				<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
			</CFOUTPUT>
		</CFIF>
		<CFIF sWarn NEQ "">
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="There was a problem!">
				<CFOUTPUT>
					<BR><FONT COLOR="##FF0000"><B>#sWarn#</B></FONT><BR>
						<A HREF="javascript:history.back()">Back to Previous Screen</A>
					</CFOUTPUT>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
		<CFELSE>
			<!--- everything's under control --->
			<CFSET sAppType = nameModule>
			<!---
			<CFIF isdefined("url.powermast")>
				<CFIF isDefined("FORM.btnAddEmployee") OR ISDEFINED("FORM.REFRESH")>
					<CFINCLUDE TEMPLATE="addppoweruser.cfm">
				<CFELSEIF ISDEFINED("FORM.btnfilter") OR (ISDEFINED("URL.ACTION") AND URL.ACTION EQ "EDITFILTER")>
					<CFSET sTypeID='powerWSUser'>
					<CFSET sTypeIDEnc = urlencodedformat(encrypt(sTypeID, client.ek))>
					<CFINCLUDE TEMPLATE="masteruser.cfm">
				<CFELSE>
					<CFINCLUDE TEMPLATE="masteruser.cfm">
				</CFIF>
			<CFELSEIF (isDefined("Form.btnAddEDTR") OR IsDefined("url.edit") OR IsDefined("url.replicate")) AND NOT ISDEFINED("FORM.btnBackMgr") AND NOT ISDEFINED("Form.btnAction")>
				<CFINCLUDE TEMPLATE="_details.cfm">
			<CFELSE>
				<CFINCLUDE TEMPLATE="_browse.cfm">
			</CFIF>--->
			<CFOUTPUT>
			<CFMODULE template="#CLIENT.COMMON_PATH#cfm_geturlvariables.cfm" REMOVEURL="edit,delete">
			<!---<CFQUERY name="getFIELDS" datasource="#CLIENT.GLOBAL_DSN#">
				SELECT COLUMNNAME,ISVISIBLEEFORM,COLUMNDESC
				FROM GRGBOSETABLEFIELDS
				WHERE TABLENAME = 'ECRGDTR'
			</CFQUERY>--->
			<CFQUERY name="qryECRGDTR" datasource="#CLIENT.COMPANY_DSN#">
				SELECT A.EDTRCODE,A.EDTRGROUP,A.EDTRDESC, A.VIEWUNTIL, A.UPDATEUNTIL, A.CUTOFF,
					B.CUTOFFSTARTDATE,B.CUTOFFENDDATE,A.SHAREDVIEW,A.SHAREDUPDATE
				FROM ECRGDTR A,CRGTKFILES B
				WHERE A.TKFILENAME_FK = B.TKFILENAME
					ORDER BY B.CUTOFFSTARTDATE DESC,A.EDTRGROUP
			</CFQUERY>
			<CFIF STRUCTKEYEXISTS(FORM,"btnNEWEDTR") or STRUCTKEYEXISTS(url,"edit") or STRUCTKEYEXISTS(url,"copy")>
				<CFINCLUDE template="./gui_newedtr.cfm">
				<CFABORT>
			</CFIF>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Browse eDTR">
			<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH="90%">
			<CFFORM name="frmEDTRMANAGER" method="post" format="HTML">
				<TR height="10"><TD></TD></TR>
				<TR><TD><CFINPUT type="submit" name="btnNEWEDTR" value="new eDTR"></TD></TR>
				<TR height="1"><TD></TD></TR>
				<TR><TD></TD><TD align="center">GROUP</TD><TD align="center">DESCRIPTION</TD><TD align="center">CUTOFF<br>START DATE</TD><TD align="center">CUTOFF<br>END DATE</TD><TD align="center">SHARED VIEW</TD><TD align="center">SHARED UPDATE</TD><TD align="center">VIEW UNTIL</TD><TD align="center">UPDATE UNTIL</TD><TD align="center">CUT-OFF<BR>DATE and TIME</TD></TR>
				<CFLOOP query="qryECRGDTR">
					<CFSET AROW = CURRENTROW>
					<tr bgcolor="#IIf(CurrentRow Mod 2, "client.color_tblset2", "client.color_tblset1")#" valign="top"><CFSET encEDTRCODE = URLENCODEDFORMAT(ENCRYPT(qryECRGDTR.EDTRCODE[AROW],CLIENT.EK))>
						<TD align="center"><a href="#getfilefrompath(getbasetemplatepath())#?edit=#encEDTRCODE#">edit</a>&nbsp;&nbsp;&nbsp;<a href="#getfilefrompath(getbasetemplatepath())#?delete=#encEDTRCODE#" onClick="javascript: return confirm('are you sure you want to delete this eDTR?')">delete</a>&nbsp;&nbsp;&nbsp;<a href="#getfilefrompath(getbasetemplatepath())#?copy=#encEDTRCODE#">copy</a></TD>
						<TD align="center">#qryECRGDTR.EDTRGROUP[AROW]#</TD>
						<TD align="center">#qryECRGDTR.EDTRDESC[AROW]#</TD>
						<TD align="center">#DATEFORMAT(qryECRGDTR.CUTOFFSTARTDATE[AROW])#</TD>
						<TD align="center">#DATEFORMAT(qryECRGDTR.CUTOFFENDDATE[AROW])#</TD>
						<TD align="center">#qryECRGDTR.SHAREDVIEW[AROW]#</TD>
						<TD align="center">#qryECRGDTR.SHAREDUPDATE[AROW]#</TD>
						<TD align="center">#DATEFORMAT(qryECRGDTR.VIEWUNTIL[AROW])#</TD>
						<TD align="center">#DATEFORMAT(qryECRGDTR.UPDATEUNTIL[AROW])#</TD>
						<TD align="center">#DATEFORMAT(qryECRGDTR.CUTOFF)#&nbsp;&nbsp;&nbsp;#TIMEFORMAT(qryECRGDTR.CUTOFF)#</TD>
					</TR>
				</CFLOOP>
			</CFFORM>
			</TABLE>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="FALSE">
			</CFOUTPUT>
		</CFIF>
		<CFMODULE TEMPLATE="#client.common_path#cfm_workspace.cfm" TOP="False">
	</BODY>
</HTML>

